import { LocaleType, type IWorkbookData } from '@univerjs/presets'
import type { IReq } from './type'
import type { IFormDataIntervalDto } from '@/components/sheets/CmpSheets'

// https://docs.univer.ai/zh-CN/guides/sheets/getting-started/workbook-data#完整示例
export const workbookData: IWorkbookData = {
  id: 'gyI0JO',
  sheetOrder: ['RSfWjJFv4opmE1JaiRj80'],
  name: '',
  appVersion: '0.5.0',
  locale: LocaleType.ZH_CN,
  styles: {},
  sheets: {
    RSfWjJFv4opmE1JaiRj80: {
      id: 'RSfWjJFv4opmE1JaiRj80',
      name: '测试',
      tabColor: '',
      hidden: 0,
      rowCount: 50,
      columnCount: 20,
      zoomRatio: 1,
      freeze: {
        startRow: -1,
        startColumn: -1,
        ySplit: 0,
        xSplit: 0,
      },
      scrollTop: 0,
      scrollLeft: 0,
      defaultColumnWidth: 73,
      defaultRowHeight: 23,
      mergeData: [],
      cellData: {
        '0': {
          '0': {
            s: 'MCuXpP',
            v: '所属科室',
            t: 1,
          },
          '1': {
            s: 'MCuXpP',
            v: '输液标签条码',
            t: 1,
          },
          '2': {
            s: 'MCuXpP',
            v: '主要涉及药品',
            t: 1,
          },
          '3': {
            s: 'MCuXpP',
            v: '标签是否完整',
            t: 1,
          },
          '4': {
            s: 'MCuXpP',
            v: '各工序是否完成',
            t: 1,
          },
          '5': {
            s: 'MCuXpP',
            v: '外观是否完整',
            t: 1,
          },
          '6': {
            s: 'MCuXpP',
            v: '是否渗透',
            t: 1,
          },
          '7': {
            s: 'MCuXpP',
            v: '是否有异物',
            t: 1,
          },
          '8': {
            s: 'MCuXpP',
            v: '所抽科室理论数与实物是否一致',
            t: 1,
          },
          '9': {
            s: 'MCuXpP',
            v: '备注',
            t: 1,
          },
          '10': {
            s: 'MCuXpP',
            v: '提交人',
            t: 1,
          },
          '11': {
            s: 'MCuXpP',
            v: '提交时间',
            t: 1,
          },
        },
        '1': {
          '0': {
            s: 'MCuXpP',
            v: '$arr{dept}',
            t: 1,
          },
          '1': {
            s: 'MCuXpP',
            v: '$arr{barCode}',
            t: 1,
          },
          '2': {
            s: 'MCuXpP',
            v: '$arr{drug}',
            t: 1,
          },
          '3': {
            s: 'MCuXpP',
            v: '$arr{isTagFull}',
            t: 1,
          },
          '4': {
            s: 'MCuXpP',
            v: '$arr{isDone}.color(value === "是" ? "#FF0000": "yellow")',
            t: 1,
          },
          '5': {
            s: 'MCuXpP',
            v: '$arr{isFull}',
            t: 1,
          },
          '6': {
            s: 'MCuXpP',
            v: '$arr{isInfiltration}',
            t: 1,
          },
          '7': {
            s: 'MCuXpP',
            v: '$arr{hasforeignBody}',
            t: 1,
          },
          '8': {
            s: 'MCuXpP',
            v: '$arr{IsConsistent}',
            t: 1,
          },
          '9': {
            s: 'MCuXpP',
            v: '$arr{remark}',
            t: 1,
          },
          '10': {
            s: 'MCuXpP',
            v: '$arr{createUserName}',
            t: 1,
          },
          '11': {
            s: 'MCuXpP',
            v: '$arr{createTime}',
            t: 1,
          },
        },
      },
      rowData: {},
      columnData: {
        // '0': {
        //   w: 125,
        //   hd: 0,
        // },
        // '1': {
        //   w: 125,
        //   hd: 0,
        // },
        // '2': {
        //   w: 125,
        //   hd: 0,
        // },
        // '3': {
        //   w: 125,
        //   hd: 0,
        // },
        // '4': {
        //   w: 125,
        //   hd: 0,
        // },
        // '5': {
        //   w: 125,
        //   hd: 0,
        // },
        // '6': {
        //   w: 125,
        //   hd: 0,
        // },
        // '7': {
        //   w: 125,
        //   hd: 0,
        // },
        // '8': {
        //   w: 125,
        //   hd: 0,
        // },
        // '9': {
        //   w: 125,
        //   hd: 0,
        // },
      },
      showGridlines: 1,
      rowHeader: {
        width: 46,
        hidden: 0,
      },
      columnHeader: {
        height: 20,
        hidden: 0,
      },
      rightToLeft: 0,
    },
  },
  resources: [
    {
      name: 'SHEET_DEFINED_NAME_PLUGIN',
      data: '',
    },
  ],
}

export const reqData: IReq<Array<IFormDataIntervalDto>> = {
  errorCode: 200,
  topMessage: '',
  data: [
    {
      storage: '141917',
      id: '26f701f0-3699-405c-96a9-11781cae660b',
      temId: 'f5d2b156-e62f-4051-a9dc-4d389a25954a',
      formId: '2ec64363-b286-4950-9d8a-5fb405a07b1c',
      formName: '静配中心 成品输液质量检查表',
      formData:
        '{"dept":"呼吸内科","barCode":"123","drug":"123","isTagFull":"是","isTagFull_label":"是","isDone":"是","isDone_label":"是","isFull":"是","isFull_label":"是","isInfiltration":"否","isInfiltration_label":"否","hasforeignBody":"否","hasforeignBody_label":"否","IsConsistent":"是","IsConsistent_label":"是","remark":"","dept_label":"呼吸内科"}',
      remark: '',
      enabled: true,
      createUser: '0646',
      createUserName: '董瑞祥',
      createTime: '2025-03-18 09:35:27',
      lastUpdateTime: '2025-03-18 09:35:27',
      lastUpdateUser: '管理员',
      isTimeOut: false,
      isValidFail: false,
      state: 1,
      stateName: '未审核',
      scheduleId: null,
    },
    {
      storage: '141917',
      id: '06107bec-62ba-467a-b38c-a3f5fe8ad112',
      temId: 'f5d2b156-e62f-4051-a9dc-4d389a25954a',
      formId: '2ec64363-b286-4950-9d8a-5fb405a07b1c',
      formName: '静配中心 成品输液质量检查表',
      formData:
        '{"dept":"呼吸内科","barCode":"D13910429","drug":"葡萄糖123123","isTagFull":"是","isTagFull_label":"是","isDone":"是","isDone_label":"是","isFull":"是","isFull_label":"是","isInfiltration":"否","isInfiltration_label":"否","hasforeignBody":"否","hasforeignBody_label":"否","IsConsistent":"是","IsConsistent_label":"是","remark":"一致, 无其他内容","dept_label":"呼吸内科"}',
      remark: '',
      enabled: true,
      createUser: 'admin',
      createUserName: '管理员',
      createTime: '2024-11-25 13:30:33',
      lastUpdateTime: '2025-03-18 09:35:27',
      lastUpdateUser: '管理员',
      isTimeOut: false,
      isValidFail: false,
      state: 1,
      stateName: '未审核',
      scheduleId: null,
    },
  ],
}
